package light.head.model.el;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;
/**
 * 受训报告
 */
@Table
@Entity
public class TrainedReport implements Serializable{
	
	private static final long serialVersionUID = -4594939079607469270L;
	private Integer code;				// 流水号
	private Integer clc;				// 班级编号
	private Integer uc;					// 学员编号
	private Byte answer;				// 回答答案
	private String testimonials;		// 受训感言
	private Integer trc;				// 题目编号
	private Integer oc;					// 机构编号
	private Date ct;					// 创建时间
	private Boolean deleted = false;	// 是否删除
	
	
	private String ucn;					// 学员姓名
	private String on;					// 机构名称
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getClc() {
		return clc;
	}
	@Column
	public Integer getUc() {
		return uc;
	}
	@Column
	public Byte getAnswer() {
		return answer;
	}
	@Column(length = 3000)
	public String getTestimonials() {
		return testimonials;
	}
	@Column
	public Integer getTrc() {
		return trc;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Date getCt() {
		return ct;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Formula("(SELECT ui.realName FROM UserInfo ui WHERE ui.code = uc)")
	public String getUcn() {
		return ucn;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getOn() {
		return on;
	}
	public void setOn(String on) {
		this.on = on;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setClc(Integer clc) {
		this.clc = clc;
	}
	public void setUc(Integer uc) {
		this.uc = uc;
	}
	public void setAnswer(Byte answer) {
		this.answer = answer;
	}
	public void setTestimonials(String testimonials) {
		this.testimonials = testimonials;
	}
	public void setTrc(Integer trc) {
		this.trc = trc;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setUcn(String ucn) {
		this.ucn = ucn;
	}
}
